﻿Namespace moteurTauxGaranti1
    ''' <summary>
    ''' Permet de stocker les résultats du moteur de calcul par équilibre tarifaire
    ''' </summary>
    ''' <remarks></remarks>
    Public Class resultatsMoteur1
        Inherits PTIC_Util.BaseNotifyPropertyChangeComponentModel
        Implements IresultatsMoteur1

        Private _PPurePf As Double
        ''' <summary>
        ''' Prime pure du portefeuille
        ''' </summary>
        ''' <remarks></remarks>
        Public Property PPurePf() As Double Implements IresultatsMoteur1.PPurePf
            Get
                Return _PPurePf
            End Get
            Set(ByVal value As Double)
                OnPropertyChanging("PPurePf")
                OnPropertyChanging("SP")
                OnPropertyChanging("ChargementTech")
                _PPurePf = value
                OnPropertyChanged("PPurePf")
                OnPropertyChanged("SP")
                OnPropertyChanged("ChargementTech")
            End Set
        End Property

        Private _PTechPf As Double
        ''' <summary>
        ''' Prime technique du portefeuille
        ''' </summary>
        ''' <remarks></remarks>
        Public Property PTechPf() As Double Implements IresultatsMoteur1.PTechPf
            Get
                Return _PTechPf
            End Get
            Set(ByVal value As Double)
                OnPropertyChanging("PTechPf")
                OnPropertyChanging("SP")
                OnPropertyChanging("ChargementTech")
                _PTechPf = value
                OnPropertyChanged("PTechPf")
                OnPropertyChanged("SP")
                OnPropertyChanged("ChargementTech")
            End Set
        End Property

        Private _sommeCSR As Double
        ''' <summary>
        ''' Somme des capitaux sous risque du portefeuille
        ''' </summary>
        ''' <remarks></remarks>
        Public Property sommeCSR() As Double Implements IresultatsMoteur1.sommeCSR
            Get
                Return _sommeCSR
            End Get
            Set(ByVal value As Double)
                OnPropertyChanging("sommeCSR")
                _sommeCSR = value
                OnPropertyChanged("sommeCSR")
            End Set
        End Property

        Private _calculsDetailles As DataTable
        Public Property CalculsDetailles As DataTable Implements IresultatsMoteur1.CalculsDetailles
            Get
                Return _calculsDetailles
            End Get
            Set(ByVal value As DataTable)
                OnPropertyChanging("CalculsDetailles")
                _calculsDetailles = value
                OnPropertyChanged("CalculsDetailles")
            End Set
        End Property

        Public ReadOnly Property SP As Double Implements IresultatsMoteur1.SP
            Get
                Return PPurePf / PTechPf
            End Get
        End Property
        Public ReadOnly Property ChargementTech As Double Implements IresultatsMoteur1.ChargementTech
            Get
                Return 1 - SP
            End Get
        End Property
    End Class
End Namespace
